package com.demo.generics.meixianzhi;

/**
 * @Description:
 * @Author: xiangty
 * @Date: 2018-07-24
 */
public class MyCat {

    /**
     * 泛型方法
     *
     * @param food
     * @param <T>
     */
    public <T> void eat(T food) {
        System.out.println("我的猫吃:" + food);
    }


    public static void main(String[] args) {
        MyCat myCat = new MyCat();

        myCat.eat("字符串");

        myCat.eat(12345);
        myCat.eat(System.currentTimeMillis());
        myCat.eat(new Person());
    }


}
